Computing ML Equality Kinds Using Abstract Interpretation

نویسندگان

  • Carl A. Gunter
  • Elsa L. Gunter
  • David B. MacQueen
چکیده

The de nition of Standard ML provides a form of generic equality which is inferred for certain types, called equality types, on which it is possible to de ne an equality relation in ML. However, the standard de nition is incomplete in the sense that there are interesting and useful types which are not inferred to be equality types but for which an equality relation can be de ned in ML in a uniform manner. In this paper, a re nement of the Standard ML system of equality types is introduced and is proven sound and complete with respect to the existence of a de nable equality. The technique used here is based on an abstract interpretation of ML operators as monotone functions over a three point lattice. It is shown how the equality relation can be de ned (as an ML program) from the de nition of a type with our equality property. Finally, a sound, e cient algorithm for inferring the equality property which corrects the limitations of the standard de nition in all cases of practical interest is demonstrated. 1 Equality Types in Standard ML The ML language provides an extensible algebra of type constructions. The Standard ML dialect divides types into two classes, those which admit equality (also called equality types) and those which do not. This distinction is based on the structure of types. Primitive types like int and string have a prede ned equality operation, while equality can be de ned over compound types built up from primitive types using \concrete" constructions like product and disjoint union in the usual componentwise manner. Function types on the other hand do not posses a de nable equality relation (the existence of such a relation would solve the halting problem), nor do user-de ned abstract types (the compiler cannot determine when two concrete representations correspond to the same abstract value). As a rst approximation, therefore, the types admitting equality can be identi ed with the \hereditarily concrete" types built from primitive types using concrete type Information and Computation, vol. 2 (1993), pp. 303{323.

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

An Abstract Interpretation for ML Equality Kinds

The definition of Standard ML provides a form of generic equality which is inferred for certain types, called equality types, on which it is possible to define an equality relation in ML. However, the standard definition is incomplete in the sense that there are interesting and useful types which are not inferred to be equality types but for which an equality relation can be defined in ML in a ...

متن کامل

Conjunctive Abstract Interpretation Using Paramodulation

Scaling static analysis is one of the main challenges for program verification in general and for abstract interpretation in particular. One way to compactly represent a set of states is using a formula in conjunctive normal form (CNF). This can sometimes save exponential factors. Therefore, CNF formulae are commonly used in manual program verification and symbolic reasoning. However, it is not...

متن کامل

Analysis of the Equality Relations for the Program Terms

In this article an abstract interpretation and formal language based analysis for imperative programs is presented. This analysis makes a lower approximation of the equality relations for the program terms, i.e. for a given program point our analysis produces a set of equalities t1 = t2 where t1 and t2 represent program expressions such that their values are equal for any behavior of the progra...

متن کامل

Behavioural Theories

Behavioural theories are a generalization of standard theories where the equality predicate is interpreted by an arbitrary (possibly partial) congruence relation, called behavioural equality. In this paper we first show how to reduce the behavioural theory of any class C of Σ-algebras to (a subset of) the standard theory of some corresponding class of algebras. Then we consider infinitary axiom...

متن کامل

Environment Analysis of Higher-Order Languages

Any analysis of higher-order languages must grapple with the tri-facetted nature of λ. In one construct, the fundamental control, environment and data structures of a language meet and intertwine. With the control facet tamed nearly two decades ago, this work brings the environment facet to heel, defining the environment problem and developing its solution: environment analysis. Environment ana...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:
  • Inf. Comput.

دوره 107  شماره 

صفحات  -

تاریخ انتشار 1993